import React, { Fragment } from 'react';
import DocumentTitle from 'react-document-title';
import Link from 'umi/link';
import { Icon } from 'antd';
import classnames from 'classnames'
import GlobalFooter from '@/components/GlobalFooter';
import defaultSettings from '@/defaultSettings';
import logo from '@/assets/logo.png';
import styles from './UserLayout.less';

const copyright = (
  <Fragment>
    <section style={{color: '#fff'}}>Copyright <Icon type="copyright" /> 2018 {defaultSettings.company}</section>
  </Fragment>
);

class UserLayout extends React.PureComponent {
  render() {
    const {
      children
    } = this.props;
    return (
      <DocumentTitle title={`登录 - ${defaultSettings.title}`}>
        <div className={classnames(styles.container, 'fadeInRight', 'animated')}>
          <div className={styles.lang}>
            {/*
              <SelectLang />
            */}
          </div>
          <div className={styles.content}>
            <div className={styles.top}>
              <div className={styles.header}>
                <Link to="/">
                  <img alt="logo" className={styles.logo} src={logo} />
                  <span className={styles.title}>{defaultSettings.title}</span>
                </Link>
              </div>
              <div className={styles.desc}>{defaultSettings.subtitle}</div>
            </div>
            {children}
          </div>
          <GlobalFooter copyright={copyright} />
        </div>
      </DocumentTitle>
    );
  }
}

export default UserLayout;